import { service } from "@/utils/request";

/**
 * 
 * @param {零售-(待入库,待出库,档案管理)};
 * @param {导出}
 * @returns 
 * 
 */
export const downloadTable = (data: object) => {
  return service({
    url: '/basic-data/wait/lib/exportExcel/excel',
    method: 'post',
    data,
    responseType: 'blob'
  })
};

/**
 * 
 * @param {零售-待入库};
 * @param {下载模板}
 * @returns 
 * 
 */
export const downloadTemplate = () => {
  return service({
    url: '/retail/wait/lib/download/excel',
    method: 'get',
    responseType: 'blob'
  })
};

/**
 * 
 * @param {零售-待入库列表查询};
 * @param {列表查询}
 * @returns 
 * 
 */
export const getList = (data: object) => {
  return service({
    url: '/basic-data/common/archives/list',
    method: 'post',
    data: data
  })
};

/**
 * 
 * @param {零售-待入库};
 * @param {详情查询} 
 * @returns 
 * 
 */
export const getRows = (data: any) => {
  return service({
    url: '/basic-data/wait/lib/get',
    method: 'post',
    data: data
  })
};

/**
 * 
 * @param {零售-待入库};
 * @param {批量入库} 
 * @returns 
 * 
 */
export const importExcel = (data: object) => {
  return service({
    url: '/basic-data/wait/lib/importExcel/excel',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data
  })
};

/**
 * 
 * @param {零售-待入库批量入库失败下载};
 * @returns 
 * 
 */
export const importExcelErr = (data: object) => {
  return service({
    url: '/retail/wait/out/lib/exportExcel/failExcel',
    method: 'post',
    responseType: 'blob',
    data
  })
};

/**
 * 
 * @param {零售-(待入库,待出库,档案记录)};
 * @param {档案操作记录}
 * @returns 
 * 
 */
export const filesOperationRecord = (data: object) => {
  return service({
    url: '/retail/change/log',
    method: 'post',
    data
  })
};


/**
 * 
 * @param {零售-待入库};
 * @param {单条入库}
 * @returns 
 * 
 */
export const inHome = (data: object) => {
  return service({
    url: '/basic-data/wait/lib/inbound',
    method: 'post',
    data
  })
};
